//package cn.joeg.web.core.interceptor;
//
//import com.ecfront.dew.common.Resp;
//import com.ecfront.dew.common.interceptor.DewInterceptRespBody;
//import com.pubinfo.samantha.app.css.service.DataDriveProducerService;
//import com.pubinfo.samantha.app.css.widget.core.vo.WidgetDataReq;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.util.Map;
//
//@Component
//public class WidgetKeyDataInterceptor extends WidgetDataFetchInterceptor {
//
//    @Autowired
//    private DataDriveProducerService dataDriveProducerService;
//
//    @Override
//    public Resp<DewInterceptRespBody<WidgetDataReq>> before(WidgetDataReq obj, Map<String, Object> context) {
//        return Resp.success(DewInterceptRespBody.build(obj, context));
//    }
//
//    @Override
//    public Resp<DewInterceptRespBody<WidgetDataReq>> after(WidgetDataReq obj, Map<String, Object> context) {
//        if (obj.getWidgetDataResp().ok() && obj.getWidgetDataResp().getBody().getData() != null) {
//            dataDriveProducerService.filterKeyData(obj.getWidgetDataResp().getBody().getData());
//        }
//        return Resp.success(DewInterceptRespBody.build(obj, context));
//    }
//}
